
<%@ page import="comptadub.NoteDeFrais" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="noteDeFrais.show.label" /></title>
    </head>

    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="noteDeFrais.list.label" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="noteDeFrais.new.label" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="noteDeFrais.show.label" /></h1>

            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            
            <div class="dialog">
                <table>
                    <tbody>
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="noteDeFrais.credit.label" default="Montant" /></td>
                            <td valign="top" class="value">
                                <g:formatNumber number="${noteDeFraisInstance.credit}" format="#0.00 &euro';'" />
                            </td>
                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="noteDeFrais.date.label" default="Date" /></td>
                            <td valign="top" class="value"><g:formatDate date="${noteDeFraisInstance?.date}" /></td>
                        </tr>

                        <g:if test="${session?.typeMembre == 'admin'}">
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="noteDeFrais.membre.label" default="Membre" /></td>
                            <td valign="top" class="value">${noteDeFraisInstance?.membre?.nom}</td>
                        </tr>
                        </g:if>
                    
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="noteDeFrais.description.label" default="Description" /></td>                            
                            <td valign="top" class="value">${fieldValue(bean: noteDeFraisInstance, field: "description")}</td>                            
                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="noteDeFrais.numeroFacture.label" default="Numéro de Facture" /></td>
                            <td valign="top" class="value">${fieldValue(bean: noteDeFraisInstance, field: "numeroFacture")}</td>
                        </tr>

                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="noteDeFrais.commentaire.label" default="Commentaire" /></td>
                            <td valign="top" class="value">${fieldValue(bean: noteDeFraisInstance, field: "commentaire")}</td>
                        </tr>

						<g:if test="${session?.typeMembre == 'admin'}">
	                        <g:if test="${noteDeFraisInstance.pathJustificatif}">
	                        <tr class="prop">
	                            <td valign="top" class="name"><g:message code="noteDeFrais.justificatif.label" default="Justificatif" /></td>
	                            <td valign="top" class="value">
	                                <a href="${createLink(controller:'noteDeFrais', action:'image', params: [id: noteDeFraisInstance.pathJustificatif])}"">Télécharger le justificatif</a>
	                            </td>
	                        </tr>
	                        </g:if>
                        </g:if>
                    </tbody>
                </table>
            </div>

            <g:form>
                <div class="buttons">
                    <g:hiddenField name="id" value="${noteDeFraisInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
